package middware

import (
	"gateway/core"
	"net/http"
)

func Auth() core.MiddlewareFunc {
	return func(ctx *core.Context) bool {
		token := ctx.GetHeader("Authorization")
		if token != "wyn" {
			ctx.JSON(http.StatusUnauthorized, map[string]string{"error": "Unauthorized"})
			return false
		}
		return true
	}
}
